package com.halflife.comeElectricity.batteryBox;

import com.halflife.comeElectricity.battery.Battery;
import com.halflife.comeElectricity.batteryCabinet.BatteryCabinet;
import com.halflife.framework.generator.annotation.Join;
import com.halflife.framework.generator.annotation.QueryAnn;

/**
 * Created by zhaoyf on 2018/6/4.
 */
@QueryAnn(title = "电池箱",mainTitle = "电箱管理",table = "t_batterybox")
public class BatteryBox {
    public enum BatteryBoxStatus{
        NORMAL,EMPTY,ERROR
    }
    private Integer id;
    @QueryAnn(value = "编码", operate = "like",refered = true)
    private String no;
    @QueryAnn(value = "名称", operate = "like",refered = true)
    private String name;
    @QueryAnn(value = "备注")
    private String memo;
    @QueryAnn(value = "状态",refered = true)
    private Integer status;
    @QueryAnn(value = "是否有效")
    private Boolean valid;
    @QueryAnn(value = "电池柜Id")
    private Integer batteryCabinetId;
    @QueryAnn(value = "电池")
    private Integer batteryId;
    @QueryAnn(value = "电池")
    @Join()
    private Battery battery;
    @QueryAnn(value = "电池柜")
    @Join()
    private BatteryCabinet batteryCabinet;

    public void init() {
        this.setValid(Boolean.TRUE);
        this.setStatus(BatteryBoxStatus.NORMAL.ordinal());
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getNo() {
        return no;
    }

    public void setNo(String no) {
        this.no = no;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Boolean getValid() {
        return valid;
    }

    public void setValid(Boolean valid) {
        this.valid = valid;
    }

    public Integer getBatteryCabinetId() {
        return batteryCabinetId;
    }

    public void setBatteryCabinetId(Integer batteryCabinetId) {
        this.batteryCabinetId = batteryCabinetId;
    }

    public Integer getBatteryId() {
        return batteryId;
    }

    public void setBatteryId(Integer batteryId) {
        this.batteryId = batteryId;
    }

    public Battery getBattery() {
        return battery;
    }

    public void setBattery(Battery battery) {
        this.battery = battery;
    }

    public BatteryCabinet getBatteryCabinet() {
        return batteryCabinet;
    }

    public void setBatteryCabinet(BatteryCabinet batteryCabinet) {
        this.batteryCabinet = batteryCabinet;
    }

}
